package tianqi.service.index.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

import net.sf.json.JSONArray;
import tianqi.Dao.index.indexDao;
import tianqi.entity.Lunbo;
import tianqi.entity.UserY;
import tianqi.service.index.IndexService;

@Service
public class IndexServiceImpl implements IndexService {
	@Autowired
	private indexDao indexDao;
	
	
	
	@Override
	public String queryProduct(Model m) {
		
		m.addAttribute("list", indexDao.queryProduct());
		return "youge";
	}



	@Override
	public String queryLunbo() {
		List<Lunbo> queryLunbo = indexDao.queryLunbo();
		JSONArray json=new JSONArray();
		json.addAll(queryLunbo);
		String str = json.toString();
		System.out.println(str);
		return str;
	}



	
}
